home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / c / cweb31p9d.lha / CWeb / cweave.ch < prev    next >
Text File  |  1994-07-02  |  61KB  |  1,995 lines

  1.                                 -*-Web-*-
  2. This file, CWEAVE.CH, is part of CWEB.
  3. It is a changefile for CWEAVE.W, Version 3.1.
  4.  
  5. Authors and Contributors:
  6. (H2B) Hans-Hermann Bode, Universität Osnabrück,
  7.   (hhbode@@dosuni1.rz.uni-osnabrueck.de or HHBODE@@DOSUNI1.BITNET).
  8.  
  9. (KG) Klaus Guntermann, TH Darmstadt,
  10.   (guntermann@@iti.informatik.th-darmstadt.de).
  11.  
  12. (AS) Andreas Scherer,
  13.   Abt-Wolf-Straße 17, 96215 Lichtenfels, Germany.
  14.  
  15. (CS) Carsten Steger, Universität München,
  16.   carsten.steger@@informatik.tu-muenchen.de
  17.  
  18. (TW) Tomas Willis
  19.   tomas@@cae.wisc.edu
  20.  
  21. Caveat utilitor:  Some of the source code introduced by this change file is
  22. made conditional to the use of specific compilers on specific systems.
  23. This applies to places marked with `#ifdef __TURBOC__' and `#ifdef _AMIGA'.
  24.  
  25. This program is distributed WITHOUT ANY WARRANTY, express or implied.
  26.  
  27. The following copyright notice extends to this changefile only, not to
  28. the masterfile CWEAVE.W.
  29.  
  30. Copyright (C) 1993,1994 Andreas Scherer
  31. Copyright (C) 1991,1993 Carsten Steger
  32. Copyright (C) 1991-1993 Hans-Hermann Bode
  33.  
  34. Permission is granted to make and distribute verbatim copies of this
  35. document provided that the copyright notice and this permission notice
  36. are preserved on all copies.
  37.  
  38. Permission is granted to copy and distribute modified versions of this
  39. document under the conditions for verbatim copying, provided that the
  40. entire resulting derived work is distributed under the terms of a
  41. permission notice identical to this one.
  42.  
  43. Version history:
  44.  
  45. Version    Date        Author    Comment
  46. a1/t1    10 Oct 1991    H2B    First attempt for CWEAVE.W 2.1.
  47. p2    13 Feb 1992    H2B    Updated for CWEAVE.W 2.4, ANSI and Turbo
  48.                 changefiles merged together, typesetting of
  49.                 certain ANSI and special constructions fixed.
  50. p3    16 Apr 1992    H2B    Updated for CWEAVE.W 2.5.
  51. p4    22 Jun 1992    H2B    Updated for CWEAVE.W 2.6, retaining hack for
  52.                 underlining of customized iddentifiers.
  53. p5    21 Jul 1992    H2B    Extensions for C++ implemented.
  54. p5a    24 Jul 1992    KG    adaptions for other ANSI C compiler
  55. p5b    28 Jul 1992    H2B    Remaining headers converted to ANSI style.
  56. p5c    30 Jul 1992    KG    removed comments used after #endif
  57. p6    06 Sep 1992    H2B    Updated for CWEAVE.W 2.7, |dot_dot_dot| added,
  58.                 proper typesetting of formatted macro
  59.                 identifiers provided, bug in processing
  60.                 short comments fixed.
  61. p6a     15 Mar 1993     AS      adaptions for SAS/C 6.0 and use of German
  62.                                 macro file gcwebmac.tex
  63. p6b     28 Jul 1993     AS      new patch level due to minor changes
  64.         01 Aug 1993     AS      missing `ptrdiff_t' datatype included
  65. p6c    04 Sep 1993    AS    new patch level in accordance with Common
  66. p6d    09 Oct 1993    AS    Updated for CWEAVE.W 2.8. (This was p7)
  67. p7    13 Nov 1992    H2B    Converted to master change file, updated for
  68.                 CWEAVE.W 2.8. [Not released.]
  69. p7.5    29 Nov 1992    H2B    Updated for CWEAVE.W 2.9beta. [Not released.]
  70. p8    04 Dec 1992    H2B    Updated for CWEAVE.W 2.9++ (stuff went into
  71.                 the source file). [Not released.]
  72. p8a    10 Mar 1993    H2B    Restructured for public release. [Not released.]
  73. p8b    15 Apr 1993    H2B    Updated for CWEAVE.W 3.0beta. [Not released.]
  74. p8c    21 Jun 1993    H2B    Updated for final CWEAVE.W 3.0.
  75. p8d    25 Oct 1993    AS    Incorporated with AMIGA version 2.8 [p7] and
  76.                 updated to version 3.0.
  77. p8e    04 Nov 1993    AS    Minor bug fixed for UNIX and GNU-C.
  78. p9    18 Nov 1993    AS    Updated for CWEAVE.W 3.1.
  79. p9a    30 Nov 1993    AS    Minor changes and corrections.
  80. p9b    06 Dec 1993    AS    Multilinguality implemented.
  81. p9c    18 Jan 1994    AS    Version information included.
  82.     03 Mar 1994    AS    `fflush' added for `Writing the index'.
  83. p9d    13 May 1994    AS    Dynamic memory allocation.
  84.     02 Jul 1994    AS    Portability version.
  85. ------------------------------------------------------------------------------
  86. @x l.1
  87. % This file is part of CWEB.
  88. % This program by Silvio Levy and Donald E. Knuth
  89. % is based on a program by Knuth.
  90. % It is distributed WITHOUT ANY WARRANTY, express or implied.
  91. % Version 3.1 --- November 1993
  92.  
  93. % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  94. @y
  95. % This file, CWEAVE.W, is part of CWEB.
  96. % This program by Silvio Levy and Donald E. Knuth
  97. % is based on a program by Knuth.
  98. % It is distributed WITHOUT ANY WARRANTY, express or implied.
  99. % Version 2.6 --- Don Knuth, June 1992
  100. % Version 2.6 [p5] --- Hans-Hermann Bode, July 1992
  101. % Version 2.6 [p5a] --- Klaus Guntermann, July 1992
  102. % Version 2.6 [p5b] --- Hans-Hermann Bode, July 1992
  103. % Version 2.6 [p5c] --- Klaus Guntermann, July 1992
  104. % Version 2.7 --- Don Knuth, July 1992
  105. % Version 2.7 [p6] --- Hans-Hermann Bode, September 1992
  106. % Version 2.7 [p6a] --- Andreas Scherer, March 1993
  107. % Version 2.7 [p6b] --- Andreas Scherer, July 1993
  108. % Version 2.7 [p6c] --- Andreas Scherer, September 1993
  109. % Version 2.8 --- Don Knuth, September 1992
  110. % Version 2.8 [p7] --- Andreas Scherer, October 1993
  111. % Version 3.0 --- Don Knuth, June 1993
  112. % Version 3.0 [p8c] --- Hans-Hermann Bode, June 1993
  113. % Version 3.0 [p8d] --- Andreas Scherer, October 1993
  114. % Version 3.0 [p8e] --- Andreas Scherer, November 1993
  115. % Version 3.1 --- Don Knuth, November 1993
  116. % Version 3.1 [p9] --- Andreas Scherer, November 1993
  117. % Version 3.1 [p9a] --- Andreas Scherer, November 1993
  118. % Version 3.1 [p9b] --- Andreas Scherer, December 1993
  119. % Version 3.1 [p9c] --- Andreas Scherer, January 1994
  120. % Version 3.1 [p9d] --- Andreas Scherer, July 1994
  121.  
  122. % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  123. % Copyright (C) 1991-1993 Hans-Hermann Bode
  124. % Copyright (C) 1991,1993 Carsten Steger
  125. % Copyright (C) 1993,1994 Andreas Scherer
  126. @z
  127. ------------------------------------------------------------------------------
  128. @x l.30
  129. \def\title{CWEAVE (Version 3.1)}
  130. @y
  131. \def\title{CWEAVE (Version 3.1 [p9d])}
  132. @z
  133. ------------------------------------------------------------------------------
  134. @x l.34
  135.   \centerline{(Version 3.1)}
  136. @y
  137.   \centerline{(Version 3.1 [p9d])}
  138. @z
  139. ------------------------------------------------------------------------------
  140. @x l.38
  141. Copyright \copyright\ 1987, 1990, 1993 Silvio Levy and Donald E. Knuth
  142. @y
  143. Copyright \copyright\ 1987, 1990, 1993 Silvio Levy and Donald E. Knuth
  144. \smallskip\noindent
  145. Copyright \copyright\ 1991--1993 Hans-Hermann Bode
  146. \smallskip\noindent
  147. Copyright \copyright\ 1991, 1993 Carsten Steger
  148. \smallskip\noindent
  149. Copyright \copyright\ 1993, 1994 Andreas Scherer
  150. @z
  151. ------------------------------------------------------------------------------
  152. Activate this, if only the changed modules should be printed.
  153. x l.51
  154. \let\maybe=\iftrue
  155. y
  156. \let\maybe=\iffalse
  157. z
  158. ------------------------------------------------------------------------------
  159. TRANSLATION
  160. @x l.64
  161. @d banner "This is CWEAVE (Version 3.1)\n"
  162. @y
  163. @d banner get_string(MSG_BANNER_CW1)
  164. @z
  165. ------------------------------------------------------------------------------
  166. ANSI
  167. @x l.73
  168. @ We predeclare several standard system functions here instead of including
  169. their system header files, because the names of the header files are not as
  170. standard as the names of the functions. (For example, some \CEE/ environments
  171. have \.{<string.h>} where others have \.{<strings.h>}.)
  172.  
  173. @<Predecl...@>=
  174. extern int strlen(); /* length of string */
  175. extern int strcmp(); /* compare strings lexicographically */
  176. extern char* strcpy(); /* copy one string to another */
  177. extern int strncmp(); /* compare up to $n$ string characters */
  178. extern char* strncpy(); /* copy up to $n$ string characters */
  179. @y
  180. @ For string handling we include the {\mc ANSI C} system header file instead
  181. of predeclaring the standard system functions |strlen|, |strcmp|, |strcpy|,
  182. |strncmp|, and |strncpy|.
  183. @^system dependencies@>
  184.  
  185. @<Include files@>=
  186. #include <string.h>
  187. @z
  188. ------------------------------------------------------------------------------
  189. ANSI
  190. @x l.94
  191. int main (ac, av)
  192. int ac; /* argument count */
  193. char **av; /* argument values */
  194. @y
  195. int main (int ac, char **av)
  196. /* argument count and argument values */
  197. @z
  198. ------------------------------------------------------------------------------
  199. PORTABILITY, SYSTEM DEPENDENCIES
  200. @x l.139
  201. @i common.h
  202. @y
  203. @i comm-p.h
  204. @^system dependencies@>
  205. @z
  206. ------------------------------------------------------------------------------
  207. PORTABILITY
  208. @x l.223
  209. typedef struct xref_info {
  210.   sixteen_bits num; /* section number plus zero or |def_flag| */
  211.   struct xref_info *xlink; /* pointer to the previous cross-reference */
  212. } xref_info;
  213. typedef xref_info *xref_pointer;
  214. @y
  215. typedef struct xref_info {
  216.   sixteen_bits num; /* section number plus zero or |def_flag| */
  217.   struct xref_info HUGE *xlink; /* pointer to the previous cross-reference */
  218. } xref_info;
  219. typedef xref_info HUGE *xref_pointer;
  220. @z
  221. ------------------------------------------------------------------------------
  222. MEMORY ALLOCATION
  223. @x l.230
  224. xref_info xmem[max_refs]; /* contains cross-reference information */
  225. xref_pointer xmem_end = xmem+max_refs-1;
  226. @y
  227. xref_info HUGE *xmem; /* contains cross-reference information */
  228. xref_pointer xmem_end;
  229. @z
  230. ------------------------------------------------------------------------------
  231. MEMORY ALLOCATION, PORTABILITY, SYSTEM DEPENDENCIES
  232. @x l.244
  233. xref_ptr=xmem; name_dir->xref=(char*)xmem; xref_switch=0; section_xref_switch=0;
  234. @y
  235. if(!(section_text=(char *)calloc(longest_name+1,sizeof(char))))
  236.   fatal("",get_string(MSG_FATAL_CO85));
  237. section_text_end = section_text + longest_name;
  238. #ifdef __TURBOC__
  239. xmem=allocsafe(max_refs,sizeof(*xmem));
  240. #else
  241. alloc_object(xmem,max_refs,xref_info);
  242. #endif
  243. xmem_end = xmem + max_refs - 1;
  244. xref_ptr=xmem; name_dir->xref=(void HUGE*)xmem;
  245. xref_switch=0; section_xref_switch=0;
  246. @^system dependencies@>
  247. @z
  248. ------------------------------------------------------------------------------
  249. TRANSLATION
  250. @x l.256
  251. @d append_xref(c) if (xref_ptr==xmem_end) overflow("cross-reference");
  252. @y
  253. @d append_xref(c) if (xref_ptr==xmem_end) overflow(get_string(MSG_OVERFLOW_CW21));
  254. @z
  255. ------------------------------------------------------------------------------
  256. ANSI
  257. @x l.262
  258. @c
  259. void
  260. new_xref(p)
  261. name_pointer p;
  262. @y
  263. @c static void new_xref(name_pointer p)
  264. @z
  265. ------------------------------------------------------------------------------
  266. PORTABILITY
  267. @x l.279
  268.   append_xref(m); xref_ptr->xlink=q; p->xref=(char*)xref_ptr;
  269. @y
  270.   append_xref(m); xref_ptr->xlink=q; p->xref=(void HUGE*)xref_ptr;
  271. @z
  272. ------------------------------------------------------------------------------
  273. ANSI
  274. @x l.293
  275. @c
  276. void
  277. new_section_xref(p)
  278. name_pointer p;
  279. @y
  280. @c static void new_section_xref(name_pointer p)
  281. @z
  282. ------------------------------------------------------------------------------
  283. PORTABILITY
  284. @x l.306
  285.   if (r==xmem) p->xref=(char*)xref_ptr;
  286. @y
  287.   if (r==xmem) p->xref=(void HUGE*)xref_ptr;
  288. @z
  289. ------------------------------------------------------------------------------
  290. ANSI
  291. @x l.313
  292. @c
  293. void
  294. set_file_flag(p)
  295. name_pointer p;
  296. @y
  297. @c static void set_file_flag(name_pointer p)
  298. @z
  299. ------------------------------------------------------------------------------
  300. PORTABILITY
  301. @x l.323
  302.   p->xref = (char *)xref_ptr;
  303. @y
  304.   p->xref = (void HUGE*)xref_ptr;
  305. @z
  306. ------------------------------------------------------------------------------
  307. MEMORY ALLOCATION, PORTABILITY
  308. @x l.334
  309. typedef token *token_pointer;
  310. typedef token_pointer *text_pointer;
  311. @y
  312. typedef token HUGE *token_pointer;
  313. typedef token_pointer HUGE *text_pointer;
  314. @z
  315. ------------------------------------------------------------------------------
  316. MEMORY ALLOCATION, PORTABILITY
  317. @x l.343
  318. token tok_mem[max_toks]; /* tokens */
  319. token_pointer tok_mem_end = tok_mem+max_toks-1; /* end of |tok_mem| */
  320. token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
  321. token_pointer tok_ptr; /* first unused position in |tok_mem| */
  322. text_pointer text_ptr; /* first unused position in |tok_start| */
  323. text_pointer tok_start_end = tok_start+max_texts-1; /* end of |tok_start| */
  324. @y
  325. token HUGE *tok_mem; /* tokens */
  326. token_pointer tok_mem_end; /* end of |tok_mem| */
  327. token_pointer *tok_start; /* directory into |tok_mem| */
  328. token_pointer tok_ptr; /* first unused position in |tok_mem| */
  329. text_pointer text_ptr; /* first unused position in |tok_start| */
  330. text_pointer tok_start_end; /* end of |tok_start| */
  331. @z
  332. ------------------------------------------------------------------------------
  333. MEMORY ALLOCATION, SYSTEM DEPENDENCIES
  334. @x l.353
  335. tok_ptr=tok_mem+1; text_ptr=tok_start+1; tok_start[0]=tok_mem+1;
  336. @y
  337. #ifdef __TURBOC__
  338. tok_mem=allocsafe(max_toks,sizeof(*tok_mem));
  339. #else
  340. alloc_object(tok_mem,max_toks,token);
  341. #endif
  342. tok_mem_end = tok_mem + max_toks - 1;
  343. if(!(tok_start=(token_pointer *)calloc(max_texts,sizeof(token_pointer))))
  344.   fatal("",get_string(MSG_FATAL_CO85));
  345. tok_start_end = tok_start + max_texts - 1;
  346. tok_ptr=tok_mem+1; text_ptr=tok_start+1; tok_start[0]=tok_mem+1;
  347. @^system dependencies@>
  348. @z
  349. ------------------------------------------------------------------------------
  350. ANSI
  351. @x l.359
  352. @c
  353. int names_match(p,first,l,t)
  354. name_pointer p; /* points to the proposed match */
  355. char *first; /* position of first character of string */
  356. int l; /* length of identifier */
  357. eight_bits t; /* desired ilk */
  358. @y
  359. @c int names_match(name_pointer p,char *first,int l,eight_bits t)
  360. /* |p|: points to the proposed match */
  361. /* |first|:  position of first character of string */
  362. /* |l|: length of identifier */
  363. /* |t|: desired |ilk| */
  364. @z
  365. ------------------------------------------------------------------------------
  366. ANSI
  367. @x l.370
  368. void
  369. init_p(p,t)
  370. name_pointer p;
  371. eight_bits t;
  372. @y
  373. void init_p(name_pointer p,eight_bits t)
  374. @z
  375. ------------------------------------------------------------------------------
  376. PORTABILITY
  377. @x l.375
  378.   p->ilk=t; p->xref=(char*)xmem;
  379. @y
  380.   p->ilk=t; p->xref=(void HUGE*)xmem;
  381. @z
  382. ------------------------------------------------------------------------------
  383. ANSI
  384. @x l.378
  385. void
  386. init_node(p)
  387. name_pointer p;
  388. @y
  389. void init_node(name_pointer p)
  390. @z
  391. ------------------------------------------------------------------------------
  392. PORTABILITY
  393. @x l.382
  394.   p->xref=(char*)xmem;
  395. @y
  396.   p->xref=(void HUGE*)xmem;
  397. @z
  398. ------------------------------------------------------------------------------
  399. SYSTEM DEPENDENCIES
  400. We append AMIGA specific keywords from Commodore and SAS Institute.
  401. @x l.467
  402. id_lookup("while",NULL,for_like);
  403. @y
  404. id_lookup("while",NULL,for_like);
  405.  
  406. #ifdef _AMIGA
  407. if(use_amiga_keywords) {
  408.    @<Keywords specific to {\mc SAS/C}@>@;
  409.    @<Registers of the {\mc AMIGA}@>@;
  410.    @<Keywords by Commodore@>@;
  411.    }
  412. #endif
  413. @^system dependencies@>
  414. @z
  415. ------------------------------------------------------------------------------
  416. MEMORY ALLOCATION
  417. @x l.522
  418. eight_bits ccode[256]; /* meaning of a char following \.{@@} */
  419.  
  420. @ @<Set ini...@>=
  421. {int c; for (c=0; c<256; c++) ccode[c]=0;}
  422. @y
  423. eight_bits *ccode; /* meaning of a char following \.{@@} */
  424.  
  425. @ @<Set ini...@>=
  426. {int c;
  427. alloc_object(ccode,256,eight_bits);
  428. for (c=0; c<256; c++) ccode[c]=0;}
  429. @z
  430. ------------------------------------------------------------------------------
  431. ANSI
  432. @x l.562
  433. @<Predec...@>=
  434. void   skip_limbo();
  435.  
  436. @ @c
  437. void
  438. skip_limbo() {
  439. @y
  440. @<Predec...@>=
  441. static void skip_limbo(void);
  442.  
  443. @ @c
  444. static void skip_limbo(void) {
  445. @z
  446. ------------------------------------------------------------------------------
  447. ANSI
  448. @x l.587
  449. @c
  450. unsigned
  451. skip_TeX() /* skip past pure \TEX/ code */
  452. @y
  453. @c static unsigned skip_TeX(void) /* skip past pure \TEX/ code */
  454. @z
  455. ------------------------------------------------------------------------------
  456. ANSI
  457. @x l.645
  458. #include <ctype.h> /* definition of |isalpha|, |isdigit| and so on */
  459. #include <stdlib.h> /* definition of |exit| */
  460. @y
  461. #include <ctype.h> /* definition of |isalpha|, |isdigit| and so on */
  462. #include <stdlib.h> /* definition of |exit| */
  463. #include <stddef.h> /* type definition of |ptrdiff_t| */
  464. @z
  465. ------------------------------------------------------------------------------
  466. ANSI
  467. @x l.655
  468. @<Predecl...@>=
  469. eight_bits get_next();
  470.  
  471. @ @c
  472. eight_bits
  473. get_next() /* produces the next input token */
  474. {@+eight_bits c; /* the current character */
  475. @y
  476. @<Predecl...@>=
  477. static eight_bits get_next(void);
  478.  
  479. @ @c
  480. static eight_bits get_next(void) /* produces the next input token */
  481. {
  482.   eight_bits c; /* the current character */
  483. @z
  484. ------------------------------------------------------------------------------
  485. ANSI, PORTABILITY
  486. Macro invocation may have multiple side effects.
  487. @x l.798
  488.     *id_loc++='$'; *id_loc++=toupper(*loc++);
  489. @y
  490.     *id_loc++='$'; *id_loc++=toupper(*loc); *loc++;
  491. @z
  492. ------------------------------------------------------------------------------
  493. TRANSLATION
  494. @x l.821
  495.         err_print("! String didn't end"); loc=limit; break;
  496. @y
  497.         err_print(get_string(MSG_ERROR_CT67_1)); loc=limit; break;
  498. @z
  499. ------------------------------------------------------------------------------
  500. TRANSLATION
  501. @x l.825
  502.         err_print("! Input ended in middle of string"); loc=buffer; break;
  503. @y
  504.         err_print(get_string(MSG_ERROR_CT67_2)); loc=buffer; break;
  505. @z
  506. ------------------------------------------------------------------------------
  507. TRANSLATION
  508. @x l.840
  509.     printf("\n! String too long: ");
  510. @y
  511.     printf(get_string(MSG_ERROR_CT67_3));
  512. @z
  513. ------------------------------------------------------------------------------
  514. TRANSLATION
  515. @x l.855
  516.     case translit_code: err_print("! Use @@l in limbo only"); continue;
  517. @y
  518.     case translit_code: err_print(get_string(MSG_ERROR_CT68_1)); continue;
  519. @z
  520. ------------------------------------------------------------------------------
  521. TRANSLATION
  522. @x l.894
  523.     err_print("! Input ended in section name");
  524. @y
  525.     err_print(get_string(MSG_ERROR_CT72_1));
  526. @z
  527. ------------------------------------------------------------------------------
  528. TRANSLATION
  529. @x l.907
  530.   printf("\n! Section name too long: ");
  531. @y
  532.   printf(get_string(MSG_ERROR_CT72_2));
  533. @z
  534. ------------------------------------------------------------------------------
  535. TRANSLATION
  536. @x l.921
  537.     err_print("! Section name didn't end"); break;
  538. @y
  539.     err_print(get_string(MSG_ERROR_CT73_1)); break;
  540. @z
  541. ------------------------------------------------------------------------------
  542. TRANSLATION
  543. @x l.925
  544.     err_print("! Control codes are forbidden in section name"); break;
  545. @y
  546.     err_print(get_string(MSG_ERROR_CW54)); break;
  547. @z
  548. ------------------------------------------------------------------------------
  549. ANSI
  550. @x l.933
  551. @<Predecl...@>=
  552. void skip_restricted();
  553.  
  554. @ @c
  555. void
  556. skip_restricted()
  557. @y
  558. @<Predecl...@>=
  559. void skip_restricted(void);
  560.  
  561. @ @c
  562. void skip_restricted(void)
  563. @z
  564. ------------------------------------------------------------------------------
  565. TRANSLATION
  566. @x l.945
  567.     err_print("! Control text didn't end"); loc=limit;
  568. @y
  569.     err_print(get_string(MSG_ERROR_CW56_1)); loc=limit;
  570. @z
  571. ------------------------------------------------------------------------------
  572. TRANSLATION
  573. @x l.951
  574.       err_print("! Control codes are forbidden in control text");
  575. @y
  576.       err_print(get_string(MSG_ERROR_CW56_2));
  577. @z
  578. ------------------------------------------------------------------------------
  579. TRANSLATION
  580. @x l.964
  581.   if (loc>=limit) err_print("! Verbatim string didn't end");
  582. @y
  583.   if (loc>=limit) err_print(get_string(MSG_ERROR_CT74));
  584. @z
  585. ------------------------------------------------------------------------------
  586. ANSI
  587. @x l.983
  588. @ The overall processing strategy in phase one has the following
  589. straightforward outline.
  590.  
  591. @<Predecl...@>=
  592. void phase_one();
  593.  
  594. @ @c
  595. void
  596. phase_one() {
  597. @y
  598. @ The overall processing strategy in phase one has the following
  599. straightforward outline.
  600.  
  601. @<Predecl...@>=
  602. static void phase_one(void);
  603.  
  604. @ @c
  605. static void phase_one(void) {
  606. @z
  607. ------------------------------------------------------------------------------
  608. TRANSLATION
  609. @x l.1004
  610.   if (++section_count==max_sections) overflow("section number");
  611. @y
  612.   if (++section_count==max_sections) overflow(get_string(MSG_OVERFLOW_CW61));
  613. @z
  614. ------------------------------------------------------------------------------
  615. ANSI
  616. @x l.1033
  617. +wildcard| and |xref_typewriter==identifier+typewriter| and |normal==0|.
  618.  
  619. @<Predecl...@>=
  620. void C_xref();
  621.  
  622. @ @c
  623. void
  624. C_xref( spec_ctrl ) /* makes cross-references for \CEE/ identifiers */
  625.   eight_bits spec_ctrl;
  626. @y
  627. +wildcard| and |xref_typewriter==identifier+typewriter| and finally
  628. |normal==0|.
  629.  
  630. @<Predecl...@>=
  631. static void C_xref(eight_bits);
  632.  
  633. @ @c
  634. static void C_xref( eight_bits spec_ctrl )
  635.    /* makes cross-references for \CEE/ identifiers */
  636. @z
  637. ------------------------------------------------------------------------------
  638. ANSI
  639. @x l.1065
  640. @<Predecl...@>=
  641. void outer_xref();
  642.  
  643. @ @c
  644. void
  645. outer_xref() /* extension of |C_xref| */
  646. @y
  647. @<Predecl...@>=
  648. static void outer_xref(void);
  649.  
  650. @ @c
  651. static void outer_xref(void) /* extension of |C_xref| */
  652. @z
  653. ------------------------------------------------------------------------------
  654. TRANSLATION
  655. @x l.1095
  656.     case translit_code: err_print("! Use @@l in limbo only"); continue;
  657. @y
  658.     case translit_code: err_print(get_string(MSG_ERROR_CT68_1)); continue;
  659. @z
  660. ------------------------------------------------------------------------------
  661. PORTABILITY
  662. @x l.1168
  663.             else lhs->xref=(char*)q->xlink;
  664. @y
  665.             else lhs->xref=(void HUGE*)q->xlink;
  666. @z
  667. ------------------------------------------------------------------------------
  668. TRANSLATION
  669. @x l.1182
  670.     err_print("! Missing left identifier of @@s");
  671. @y
  672.     err_print(get_string(MSG_ERROR_CW71_1));
  673. @z
  674. ------------------------------------------------------------------------------
  675. TRANSLATION
  676. @x l.1187
  677.       err_print("! Missing right identifier of @@s");
  678. @y
  679.       err_print(get_string(MSG_ERROR_CW71_2));
  680. @z
  681. ------------------------------------------------------------------------------
  682. ANSI
  683. @x l.1226
  684. @<Predecl...@>=
  685. void section_check();
  686.  
  687. @ @c
  688. void
  689. section_check(p)
  690. name_pointer p; /* print anomalies in subtree |p| */
  691. @y
  692. @<Predecl...@>=
  693. static void section_check(name_pointer);
  694.  
  695. @ @c
  696. static void section_check(name_pointer p)
  697.    /* print anomalies in subtree |p| */
  698. @z
  699. ------------------------------------------------------------------------------
  700. TRANSLATION
  701. @x l.1240
  702.       printf("\n! Never defined: <"); print_section_name(p); putchar('>'); mark_harmless;
  703. @y
  704.       printf(get_string(MSG_WARNING_CW75_1));
  705.       print_section_name(p); putchar('>'); mark_harmless;
  706. @z
  707. ------------------------------------------------------------------------------
  708. TRANSLATION
  709. @x l.1245
  710.       printf("\n! Never used: <"); print_section_name(p); putchar('>'); mark_harmless;
  711. @y
  712.       printf(get_string(MSG_WARNING_CW75_2));
  713.       print_section_name(p); putchar('>'); mark_harmless;
  714. @z
  715. ------------------------------------------------------------------------------
  716. MEMORY ALLOCATION
  717. @x l.1261
  718. char out_buf[line_length+1]; /* assembled characters */
  719. char *out_ptr; /* just after last character in |out_buf| */
  720. char *out_buf_end = out_buf+line_length; /* end of |out_buf| */
  721. @y
  722. char *out_buf; /* assembled characters */
  723. char *out_ptr; /* just after last character in |out_buf| */
  724. char *out_buf_end; /* end of |out_buf| */
  725. @z
  726. ------------------------------------------------------------------------------
  727. ANSI
  728. @x l.1283
  729. void
  730. flush_buffer(b,per_cent,carryover)
  731. char *b;  /* outputs from |out_buf+1| to |b|,where |b<=out_ptr| */
  732. boolean per_cent,carryover;
  733. @y
  734. static void flush_buffer(char *b,boolean per_cent,boolean carryover)
  735.    /* outputs from |out_buf+1| to |b|, where |b<=out_ptr| */
  736. @z
  737. ------------------------------------------------------------------------------
  738. ANSI
  739. @x l.1299
  740.   if (b<out_ptr) strncpy(out_buf+1,b+1,out_ptr-b);
  741. @y
  742.   if (b<out_ptr) strncpy(out_buf+1,b+1,(size_t)(out_ptr-b));
  743. @z
  744. ------------------------------------------------------------------------------
  745. ANSI
  746. @x l.1312
  747. void
  748. finish_line() /* do this at the end of a line */
  749. @y
  750. static void finish_line(void) /* do this at the end of a line */
  751. @z
  752. ------------------------------------------------------------------------------
  753. MEMORY ALLOCATION, PORTABILITY
  754. Additionally to the AMIGA keywords there is also a German version of
  755. the TeX macros called gcwebmac.tex. You may include these macros by
  756. setting the `+g' command line switch.
  757. @x l.1327
  758. `\.{\\input cwebmac}'.
  759.  
  760. @<Set init...@>=
  761. out_ptr=out_buf+1; out_line=1; active_file=tex_file;
  762. *out_ptr='c'; tex_printf("\\input cwebma");
  763. @y
  764. `\.{\\input ccwebmac}' or `\.{\\input gcwebmac}' if the `\.{+g}' option was
  765. set.
  766.  
  767. @<Set init...@>=
  768. alloc_object(out_buf,line_length+1,char);
  769. out_buf_end = out_buf + line_length;
  770. out_ptr=out_buf+1; out_line=1; active_file=tex_file; *out_ptr='c';
  771. if(use_german_macros) tex_printf("\\input gcwebma");
  772. else tex_printf("\\input ccwebma");
  773. @z
  774. ------------------------------------------------------------------------------
  775. ANSI
  776. @x l.1344
  777. void
  778. out_str(s) /* output characters from |s| to end of string */
  779. char *s;
  780. @y
  781. static void out_str(char*s) /* output characters from |s| to end of string */
  782. @z
  783. ------------------------------------------------------------------------------
  784. ANSI
  785. @x l.1362
  786. @<Predecl...@>=
  787. void break_out();
  788.  
  789. @ @c
  790. void
  791. break_out() /* finds a way to break the output line */
  792. @y
  793. @<Predecl...@>=
  794. static void break_out(void);
  795.  
  796. @ @c static void break_out(void) /* finds a way to break the output line */
  797. @z
  798. ------------------------------------------------------------------------------
  799. TRANSLATION
  800. @x l.1388
  801.   printf("\n! Line had to be broken (output l. %d):\n",out_line);
  802. @y
  803.   printf(get_string(MSG_WARNING_CW85),out_line);
  804. @z
  805. ------------------------------------------------------------------------------
  806. ANSI
  807. @x l.1401
  808. void
  809. out_section(n)
  810. sixteen_bits n;
  811. @y
  812. static void out_section(sixteen_bits n)
  813. @z
  814. ------------------------------------------------------------------------------
  815. ANSI, PORTABILITY
  816. @x l.1415
  817. void
  818. out_name(p)
  819. name_pointer p;
  820. {
  821.   char *k, *k_end=(p+1)->byte_start; /* pointers into |byte_mem| */
  822. @y
  823. static void out_name(name_pointer p)
  824. {
  825.   char HUGE *k;
  826.   char HUGE *k_end=(p+1)->byte_start; /* pointers into |byte_mem| */
  827. @z
  828. ------------------------------------------------------------------------------
  829. ANSI
  830. @x l.1442
  831. void
  832. copy_limbo()
  833. @y
  834. static void copy_limbo(void)
  835. @z
  836. ------------------------------------------------------------------------------
  837. TRANSLATION
  838. @x l.1461
  839.         default: err_print("! Double @@ should be used in limbo");
  840. @y
  841.         default: err_print(get_string(MSG_ERROR_CT93));
  842. @z
  843. ------------------------------------------------------------------------------
  844. ANSI
  845. @x l.1477
  846. eight_bits
  847. copy_TeX()
  848. @y
  849. static eight_bits copy_TeX(void)
  850. @z
  851. ------------------------------------------------------------------------------
  852. TRANSLATION
  853. @x l.1503
  854. @d app_tok(c) {if (tok_ptr+2>tok_mem_end) overflow("token"); *(tok_ptr++)=c;}
  855. @y
  856. @d app_tok(c) {if (tok_ptr+2>tok_mem_end)
  857.     overflow(get_string(MSG_OVERFLOW_CT26));
  858.   *(tok_ptr++)=c;}
  859. @z
  860. ------------------------------------------------------------------------------
  861. ANSI
  862. @x l.1505
  863. @<Predec...@>=
  864. int copy_comment();
  865.  
  866. @ @c
  867. int copy_comment(is_long_comment,bal) /* copies \TEX/ code in comments */
  868. boolean is_long_comment; /* is this a traditional \CEE/ comment? */
  869. int bal; /* brace balance */
  870. @y
  871. @<Predec...@>=
  872. static int copy_comment(boolean,int);
  873.  
  874. @ @c static copy_comment(boolean is_long_comment,int bal)
  875.    /* copies \TeX\ code in comments */
  876.    /* |is_long_comment|: is this a traditional \CEE/ comment? */
  877.    /* |bal|: brace balance */
  878. @z
  879. ------------------------------------------------------------------------------
  880. TRANSLATION
  881. @x l.1518
  882.           err_print("! Input ended in mid-comment");
  883. @y
  884.           err_print(get_string(MSG_ERROR_CT60_1));
  885. @z
  886. ------------------------------------------------------------------------------
  887. TRANSLATION
  888. @x l.1524
  889.         if (bal>1) err_print("! Missing } in comment");
  890. @y
  891.         if (bal>1) err_print(get_string(MSG_ERROR_CW92_1));
  892. @z
  893. ------------------------------------------------------------------------------
  894. TRANSLATION
  895. @x l.1540
  896.       else {err_print("! Extra } in comment");
  897. @y
  898.       else {err_print(get_string(MSG_ERROR_CW92_2));
  899. @z
  900. ------------------------------------------------------------------------------
  901. TRANSLATION
  902. @x l.1552
  903.   if (bal>1) err_print("! Missing } in comment");
  904. @y
  905.   if (bal>1) err_print(get_string(MSG_ERROR_CW92_1));
  906. @z
  907. ------------------------------------------------------------------------------
  908. TRANSLATION
  909. @x l.1560
  910.     err_print("! Illegal use of @@ in comment");
  911. @y
  912.     err_print(get_string(MSG_ERROR_CW94));
  913. @z
  914. ------------------------------------------------------------------------------
  915. @x l.1597
  916. no such productions exist, we find to find the longest production
  917. @y
  918. no such productions exist, we try to find the longest production
  919. @z
  920. ------------------------------------------------------------------------------
  921. MEMORY ALLOCATION
  922. @x l.1670
  923. char cat_name[256][12];
  924. eight_bits cat_index;
  925.  
  926. @ @<Set in...@>=
  927. @y
  928. char **cat_name;
  929. eight_bits cat_index;
  930.  
  931. @ @<Set in...@>=
  932.     alloc_object(cat_name,256,char *);
  933.     for(cat_index=0; cat_index<255; cat_index++)
  934.       alloc_object(cat_name[cat_index],12,char);
  935. @z
  936. ------------------------------------------------------------------------------
  937. ANSI
  938. @x l.1734
  939. void
  940. print_cat(c) /* symbolic printout of a category */
  941. eight_bits c;
  942. @y
  943. static void print_cat(eight_bits c) /* symbolic printout of a category */
  944. @z
  945. ------------------------------------------------------------------------------
  946. MEMORY ALLOCATION
  947. @x l.2025
  948. scrap scrap_info[max_scraps]; /* memory array for scraps */
  949. scrap_pointer scrap_info_end=scrap_info+max_scraps -1; /* end of |scrap_info| */
  950. @y
  951. scrap *scrap_info; /* memory array for scraps */
  952. scrap_pointer scrap_info_end; /* end of |scrap_info| */
  953. @z
  954. ------------------------------------------------------------------------------
  955. MEMORY ALLOCATION
  956. @x l.2034
  957. @ @<Set init...@>=
  958. scrap_base=scrap_info+1;
  959. max_scr_ptr=scrap_ptr=scrap_info;
  960. @y
  961. @ @<Set init...@>=
  962. alloc_object(scrap_info,max_scraps,scrap);
  963. scrap_info_end = scrap_info + max_scraps - 1;
  964. scrap_base=scrap_info+1;
  965. max_scr_ptr=scrap_ptr=scrap_info;
  966. @z
  967. ------------------------------------------------------------------------------
  968. ANSI
  969. @x l.2062
  970. void
  971. print_text(p) /* prints a token list for debugging; not used in |main| */
  972. text_pointer p;
  973. @y
  974. static void print_text(text_pointer p)
  975.    /* prints a token list for debugging; not used in |main| */
  976. @z
  977. ------------------------------------------------------------------------------
  978. ANSI
  979. @x l.2180
  980. @d app(a) *(tok_ptr++)=a
  981. @d app1(a) *(tok_ptr++)=tok_flag+(int)((a)->trans-tok_start)
  982. @y
  983. @d app(a) *(tok_ptr++)=(token)(a)
  984. @d app1(a) *(tok_ptr++)=(token)(tok_flag+(int)((a)->trans-tok_start))
  985. @z
  986. ------------------------------------------------------------------------------
  987. ANSI
  988. @x l.2186
  989. @ @c
  990. void
  991. app_str(s)
  992. char *s;
  993. @y
  994. @ @c static void app_str(char *s)
  995. @z
  996. ------------------------------------------------------------------------------
  997. ANSI
  998. @x l.2194
  999. void
  1000. big_app(a)
  1001. token a;
  1002. @y
  1003. static void big_app(token a)
  1004. @z
  1005. ------------------------------------------------------------------------------
  1006. ANSI
  1007. @x l.2211
  1008. void
  1009. big_app1(a)
  1010. scrap_pointer a;
  1011. @y
  1012. static void big_app1(scrap_pointer a)
  1013. @z
  1014. ------------------------------------------------------------------------------
  1015. ANSI
  1016. @x l.2312
  1017. token_pointer
  1018. find_first_ident(p)
  1019. text_pointer p;
  1020. @y
  1021. static token_pointer find_first_ident(text_pointer p)
  1022. @z
  1023. ------------------------------------------------------------------------------
  1024. ANSI
  1025. @x l.2339
  1026. void
  1027. make_reserved(p) /* make the first identifier in |p->trans| like |int| */
  1028. scrap_pointer p;
  1029. @y
  1030. static void make_reserved(scrap_pointer p)
  1031. /* make the first identifier in |p->trans| like |int| */
  1032. @z
  1033. ------------------------------------------------------------------------------
  1034. ANSI
  1035. @x l.2356
  1036.   (name_dir+(sixteen_bits)(tok_value%id_flag))->ilk=raw_int;
  1037. @y
  1038.   (name_dir+(ptrdiff_t)(tok_value%id_flag))->ilk=raw_int;
  1039. @z
  1040. ------------------------------------------------------------------------------
  1041. ANSI
  1042. @x l.2370
  1043. void
  1044. make_underlined(p)
  1045. /* underline the entry for the first identifier in |p->trans| */
  1046. scrap_pointer p;
  1047. @y
  1048. static void make_underlined(scrap_pointer p)
  1049. /* underline the entry for the first identifier in |p->trans| */
  1050. @z
  1051. ------------------------------------------------------------------------------
  1052. ANSI
  1053. @x l.2386
  1054. @<Predecl...@>=
  1055. void  underline_xref();
  1056.  
  1057. @ @c
  1058. void
  1059. underline_xref(p)
  1060. name_pointer p;
  1061. @y
  1062. @<Predecl...@>=
  1063. static void underline_xref(name_pointer);
  1064.  
  1065. @ @c
  1066. static void underline_xref(name_pointer p)
  1067. @z
  1068. ------------------------------------------------------------------------------
  1069. PORTABILITY
  1070. @x l.2423
  1071.   p->xref=(char*)xref_ptr;
  1072. @y
  1073.   p->xref=(void HUGE*)xref_ptr;
  1074. @z
  1075. ------------------------------------------------------------------------------
  1076. PORTABILITY
  1077. CWeave indents declarations after old-style function definitions.  With the
  1078. `-i' option they will come out flush left.  You won't see any difference if
  1079. you use the ANSI-style function definitions.
  1080. @x l.2432
  1081. @<Cases for |exp|@>=
  1082. if (cat1==lbrace || cat1==int_like || cat1==decl) {
  1083.   make_underlined(pp); big_app1(pp); big_app(indent); app(indent);
  1084.   reduce(pp,1,fn_decl,0,1);
  1085. }
  1086. @y
  1087. @<Cases for |exp|@>=
  1088. if(cat1==lbrace || cat1==int_like || cat1==decl) {
  1089.   make_underlined(pp); big_app1(pp);
  1090.   if (indent_param_decl) {
  1091.     big_app(indent); app(indent);
  1092.   }
  1093.   reduce(pp,1,fn_decl,0,1);
  1094. }
  1095. @z
  1096. ----------------------------------------------------------------------
  1097. PORTABILITY
  1098. @x l.2537
  1099. @ @<Cases for |decl_head|@>=
  1100. if (cat1==comma) {
  1101.   big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
  1102. }
  1103. else if (cat1==unorbinop) {
  1104.   big_app1(pp); big_app('{'); big_app1(pp+1); big_app('}');
  1105.   reduce(pp,2,decl_head,-1,34);
  1106. }
  1107. else if (cat1==exp && cat2!=lpar && cat2!=exp) {
  1108.   make_underlined(pp+1); squash(pp,2,decl_head,-1,35);
  1109. }
  1110. else if ((cat1==binop||cat1==colon) && cat2==exp && (cat3==comma ||
  1111.     cat3==semi || cat3==rpar))
  1112.   squash(pp,3,decl_head,-1,36);
  1113. else if (cat1==cast) squash(pp,2,decl_head,-1,37);
  1114. else if (cat1==lbrace || (cat1==int_like&&cat2!=colcol) || cat1==decl) {
  1115.   big_app1(pp); big_app(indent); app(indent); reduce(pp,1,fn_decl,0,38);
  1116. }
  1117. else if (cat1==semi) squash(pp,2,decl,-1,39);
  1118. @y
  1119. @ @<Cases for |decl_head|@>=
  1120. if (cat1==comma) {
  1121.   big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
  1122. }
  1123. else if (cat1==unorbinop) {
  1124.   big_app1(pp); big_app('{'); big_app1(pp+1); big_app('}');
  1125.   reduce(pp,2,decl_head,-1,34);
  1126. }
  1127. else if (cat1==exp && cat2!=lpar && cat2!=exp) {
  1128.   make_underlined(pp+1); squash(pp,2,decl_head,-1,35);
  1129. }
  1130. else if ((cat1==binop||cat1==colon) && cat2==exp && (cat3==comma ||
  1131.     cat3==semi || cat3==rpar))
  1132.   squash(pp,3,decl_head,-1,36);
  1133. else if (cat1==cast) squash(pp,2,decl_head,-1,37);
  1134. else if (cat1==lbrace || (cat1==int_like&&cat2!=colcol) || cat1==decl) {
  1135.   big_app1(pp);
  1136.   if (indent_param_decl) {
  1137.     big_app(indent); app(indent);
  1138.   }
  1139.   reduce(pp,1,fn_decl,0,38);
  1140. }
  1141. else if (cat1==semi) squash(pp,2,decl,-1,39);
  1142. @z
  1143. ------------------------------------------------------------------------------
  1144. PORTABILITY
  1145. The original manual described the `-o' option for CWEAVE, but this was not
  1146. yet present.  Here is a simple implementation.  The purpose is to suppress
  1147. the extra space between local variable declarations and the first statement
  1148. in a function block.
  1149. @x l.2562
  1150. else if (cat1==stmt || cat1==function) {
  1151.   big_app1(pp); big_app(big_force);
  1152.   big_app1(pp+1); reduce(pp,2,cat1,-1,41);
  1153. }
  1154. @y
  1155. else if (cat1==stmt || cat1==function) {
  1156.   big_app1(pp);
  1157.   if(order_decl_stmt) big_app(big_force);
  1158.   else big_app(force);
  1159.   big_app1(pp+1); reduce(pp,2,cat1,-1,41);
  1160. }
  1161. @z
  1162. ------------------------------------------------------------------------------
  1163. PORTABILITY
  1164. @x l.2608
  1165. @ @<Cases for |fn_decl|@>=
  1166. if (cat1==decl) {
  1167.   big_app1(pp); big_app(force); big_app1(pp+1); reduce(pp,2,fn_decl,0,51);
  1168. }
  1169. else if (cat1==stmt) {
  1170.   big_app1(pp); app(outdent); app(outdent); big_app(force);
  1171.   big_app1(pp+1); reduce(pp,2,function,-1,52);
  1172. }
  1173. @y
  1174. @ @<Cases for |fn_decl|@>=
  1175. if (cat1==decl) {
  1176.   big_app1(pp); big_app(force); big_app1(pp+1); reduce(pp,2,fn_decl,0,51);
  1177. }
  1178. else if (cat1==stmt) {
  1179.   big_app1(pp);
  1180.   if (indent_param_decl) {
  1181.     app(outdent); app(outdent);
  1182.   }
  1183.   big_app(force);
  1184.   big_app1(pp+1); reduce(pp,2,function,-1,52);
  1185. }
  1186. @z
  1187. ----------------------------------------------------------------------
  1188. ANSI
  1189. @x l.2866
  1190. void
  1191. reduce(j,k,c,d,n)
  1192. scrap_pointer j;
  1193. eight_bits c;
  1194. short k, d, n;
  1195. @y
  1196. static void reduce(scrap_pointer j, short k, eight_bits c, short d, short n)
  1197. @z
  1198. ------------------------------------------------------------------------------
  1199. ANSI
  1200. @x l.2896
  1201. void
  1202. squash(j,k,c,d,n)
  1203. scrap_pointer j;
  1204. eight_bits c;
  1205. short k, d, n;
  1206. @y
  1207. static void squash(scrap_pointer j, short k, eight_bits c, short d, short n)
  1208. @z
  1209. ------------------------------------------------------------------------------
  1210. TRANSLATION
  1211. @x l.2931
  1212.     overflow("token");
  1213. @y
  1214.     overflow(get_string(MSG_OVERFLOW_CT30));
  1215. @z
  1216. ------------------------------------------------------------------------------
  1217. TRANSLATION
  1218. @x l.2935
  1219.     overflow("text");
  1220. @y
  1221.     overflow(get_string(MSG_OVERFLOW_CT76));
  1222. @z
  1223. ------------------------------------------------------------------------------
  1224. ANSI
  1225. @x l.2992
  1226. text_pointer
  1227. translate() /* converts a sequence of scraps */
  1228. @y
  1229. static text_pointer translate(void) /* converts a sequence of scraps */
  1230. @z
  1231. ------------------------------------------------------------------------------
  1232. TRANSLATION
  1233. @x l.3015
  1234.     if (tok_ptr+6>tok_mem_end) overflow("token");
  1235. @y
  1236.     if (tok_ptr+6>tok_mem_end) overflow(get_string(MSG_OVERFLOW_CT26));
  1237. @z
  1238. ------------------------------------------------------------------------------
  1239. TRANSLATION
  1240. @x l.3023
  1241.   printf("\nIrreducible scrap sequence in section %d:",section_count);
  1242. @y
  1243.   printf(get_string(MSG_WARNING_CW171),section_count);
  1244. @z
  1245. ------------------------------------------------------------------------------
  1246. TRANSLATION
  1247. @x l.3032
  1248.   printf("\nTracing after l. %d:\n",cur_line); mark_harmless;
  1249. @y
  1250.   printf(get_string(MSG_WARNING_CW172),cur_line); mark_harmless;
  1251. @z
  1252. ------------------------------------------------------------------------------
  1253. ANSI
  1254. @x l.3057
  1255. void
  1256. C_parse(spec_ctrl) /* creates scraps from \CEE/ tokens */
  1257.   eight_bits spec_ctrl;
  1258. @y
  1259. static void C_parse(eight_bits spec_ctrl)
  1260.   /* creates scraps from \CEE/ tokens */
  1261. @z
  1262. ------------------------------------------------------------------------------
  1263. TRANSLATION
  1264. @x l.3160
  1265.   overflow("scrap/token/text");
  1266. @y
  1267.   overflow(get_string(MSG_OVERFLOW_CW176));
  1268. @z
  1269. ------------------------------------------------------------------------------
  1270. TRANSLATION
  1271. @x l.3244
  1272.         else err_print("! Double @@ should be used in strings");
  1273. @y
  1274.         else err_print(get_string(MSG_ERROR_CT80));
  1275. @z
  1276. ------------------------------------------------------------------------------
  1277. @x l.3257
  1278. open, to be picked up by next scrap. If it comes at the end of a
  1279. @y
  1280. open, to be picked up by the next scrap. If it comes at the end of a
  1281. @z
  1282. ------------------------------------------------------------------------------
  1283. ANSI
  1284. @x l.3276
  1285. @<Predec...@>=
  1286. void app_cur_id();
  1287.  
  1288. @ @c
  1289. void
  1290. app_cur_id(scrapping)
  1291. boolean scrapping; /* are we making this into a scrap? */
  1292. @y
  1293. @<Predec...@>=
  1294. void app_cur_id(boolean);
  1295.  
  1296. @ @c
  1297. void app_cur_id(boolean scrapping) /* are we making this into a scrap? */
  1298. @z
  1299. ------------------------------------------------------------------------------
  1300. ANSI
  1301. @x l.3301
  1302. text_pointer
  1303. C_translate()
  1304. @y
  1305. static text_pointer C_translate(void)
  1306. @z
  1307. ------------------------------------------------------------------------------
  1308. TRANSLATION
  1309. @x l.3308
  1310.   if (next_control!='|') err_print("! Missing '|' after C text");
  1311. @y
  1312.   if (next_control!='|') err_print(get_string(MSG_ERROR_CW182));
  1313. @z
  1314. ------------------------------------------------------------------------------
  1315. ANSI
  1316. @x l.3323
  1317. void
  1318. outer_parse() /* makes scraps from \CEE/ tokens and comments */
  1319. @y
  1320. static void outer_parse(void) /* makes scraps from \CEE/ tokens and comments */
  1321. @z
  1322. ------------------------------------------------------------------------------
  1323. MEMORY ALLOCATION
  1324. @x l.3414
  1325. output_state stack[stack_size]; /* info for non-current levels */
  1326. stack_pointer stack_ptr; /* first unused location in the output state stack */
  1327. stack_pointer stack_end=stack+stack_size-1; /* end of |stack| */
  1328. @y
  1329. output_state *stack; /* info for non-current levels */
  1330. stack_pointer stack_ptr; /* first unused location in the output state stack */
  1331. stack_pointer stack_end; /* end of |stack| */
  1332. @z
  1333. ------------------------------------------------------------------------------
  1334. MEMORY ALLOCATION
  1335. @x l.3419
  1336. @ @<Set init...@>=
  1337. max_stack_ptr=stack;
  1338. @y
  1339. @ @<Set init...@>=
  1340. alloc_object(stack,stack_size,output_state);
  1341. stack_end = stack + stack_size - 1;
  1342. max_stack_ptr=stack;
  1343. @z
  1344. ------------------------------------------------------------------------------
  1345. ANSI
  1346. @x l.3427
  1347. void
  1348. push_level(p) /* suspends the current level */
  1349. text_pointer p;
  1350. @y
  1351. static void push_level(text_pointer p) /* suspends the current level */
  1352. @z
  1353. ------------------------------------------------------------------------------
  1354. TRANSLATION
  1355. @x l.3431
  1356.   if (stack_ptr==stack_end) overflow("stack");
  1357. @y
  1358.   if (stack_ptr==stack_end) overflow(get_string(MSG_OVERFLOW_CT30));
  1359. @z
  1360. ------------------------------------------------------------------------------
  1361. ANSI
  1362. @x l.3447
  1363. void
  1364. pop_level()
  1365. @y
  1366. static void pop_level(void)
  1367. @z
  1368. ------------------------------------------------------------------------------
  1369. ANSI
  1370. @x l.3469
  1371. eight_bits
  1372. get_output() /* returns the next token of output */
  1373. @y
  1374. static eight_bits get_output(void) /* returns the next token of output */
  1375. @z
  1376. ------------------------------------------------------------------------------
  1377. ANSI
  1378. @x l.3487
  1379.   return(a);
  1380. @y
  1381.   return((eight_bits)a);
  1382. @z
  1383. ------------------------------------------------------------------------------
  1384. ANSI
  1385. @x l.3511
  1386. void
  1387. output_C() /* outputs the current token list */
  1388. @y
  1389. static void output_C(void) /* outputs the current token list */
  1390. @z
  1391. ------------------------------------------------------------------------------
  1392. ANSI
  1393. @x l.3531
  1394. @<Predecl...@>=
  1395. void make_output();
  1396.  
  1397. @ @c
  1398. void
  1399. make_output() /* outputs the equivalents of tokens */
  1400. @y
  1401. @<Predecl...@>=
  1402. static void make_output(void);
  1403.  
  1404. @ @c
  1405. static void make_output(void) /* outputs the equivalents of tokens */
  1406. @z
  1407. ------------------------------------------------------------------------------
  1408. PORTABILITY
  1409. @x l.3541
  1410.   char *k, *k_limit; /* indices into |byte_mem| */
  1411. @y
  1412.   char HUGE *k;
  1413.   char HUGE *k_limit; /* indices into |byte_mem| */
  1414. @z
  1415. ------------------------------------------------------------------------------
  1416. SYSTEM DEPENDENCIES
  1417. We need a huge pointer here instead of j; k seems a good choice, since it is
  1418. declared as index into byte_mem anyhow.
  1419. @x l.3587
  1420.     for (j=cur_name->byte_start;j<(cur_name+1)->byte_start;j++)
  1421.       out(isxalpha(*j)? 'x':*j);
  1422. @y
  1423. #ifdef __TURBOC__
  1424.     for (k=cur_name->byte_start;k<(cur_name+1)->byte_start;k++)
  1425.       out(isxalpha(*k)? 'x':*k);
  1426. #else
  1427.     for (j=cur_name->byte_start;j<(cur_name+1)->byte_start;j++)
  1428.       out(isxalpha(*j)? 'x':*j);
  1429. #endif
  1430. @^system dependencies@>
  1431. @z
  1432. ------------------------------------------------------------------------------
  1433. SYSTEM DEPENDENCIES
  1434. @x l.3593
  1435.     for (j=cur_name->byte_start;j<(cur_name+1)->byte_start;j++)
  1436.       if (xislower(*j)) { /* not entirely uppercase */
  1437. @y
  1438. #ifdef __TURBOC__
  1439.     for (k=cur_name->byte_start;k<(cur_name+1)->byte_start;k++)
  1440.       if (xislower(*k)) { /* not entirely uppercase */
  1441. #else
  1442.     for (j=cur_name->byte_start;j<(cur_name+1)->byte_start;j++)
  1443.       if (xislower(*j)) { /* not entirely uppercase */
  1444. #endif
  1445. @^system dependencies@>
  1446. @z
  1447. ------------------------------------------------------------------------------
  1448. TRANSLATION
  1449. @x l.3744
  1450.   printf("\n! Illegal control code in section name: <");
  1451. @y
  1452.   printf(get_string(MSG_ERROR_CW201));
  1453. @z
  1454. ------------------------------------------------------------------------------
  1455. TRANSLATION
  1456. @x l.3759
  1457.     printf("\n! C text in section name didn't end: <");
  1458. @y
  1459.     printf(get_string(MSG_ERROR_CW202));
  1460. @z
  1461. ------------------------------------------------------------------------------
  1462. TRANSLATION
  1463. @x l.3770
  1464.       if (j>buffer+long_buf_size-3) overflow("buffer");
  1465. @y
  1466.       if (j>buffer+long_buf_size-3) overflow(get_string(MSG_OVERFLOW_CW202));
  1467. @z
  1468. ------------------------------------------------------------------------------
  1469. TRANSLATION
  1470. @x l.3778
  1471.   if (j>buffer+long_buf_size-4) overflow("buffer");
  1472. @y
  1473.   if (j>buffer+long_buf_size-4) overflow(get_string(MSG_OVERFLOW_CW202));
  1474. @z
  1475. ------------------------------------------------------------------------------
  1476. ANSI
  1477. @x l.3789
  1478. @<Predecl...@>=
  1479. void phase_two();
  1480.  
  1481. @ @c
  1482. void
  1483. phase_two() {
  1484. @y
  1485. @<Predecl...@>=
  1486. static void phase_two(void);
  1487.  
  1488. @ @c
  1489. static void phase_two(void) {
  1490. @z
  1491. ------------------------------------------------------------------------------
  1492. TRANSLATION
  1493. @x l.3795
  1494. reset_input(); if (show_progress) printf("\nWriting the output file...");
  1495. @y
  1496. reset_input(); if (show_progress) printf(get_string(MSG_PROGRESS_CW204));
  1497. @z
  1498. ------------------------------------------------------------------------------
  1499. TRANSLATION
  1500. @x l.3878
  1501.         err_print("! TeX string should be in C text only"); break;
  1502. @y
  1503.         err_print(get_string(MSG_ERROR_CW209_1)); break;
  1504. @z
  1505. ------------------------------------------------------------------------------
  1506. TRANSLATION
  1507. @x l.3884
  1508.         err_print("! You can't do that in TeX text"); break;
  1509. @y
  1510.         err_print(get_string(MSG_ERROR_CW209_2)); break;
  1511. @z
  1512. ------------------------------------------------------------------------------
  1513. ANSI
  1514. @x l.3912
  1515. @<Predecl...@>=
  1516. void finish_C();
  1517.  
  1518. @ @c
  1519. void
  1520. finish_C(visible) /* finishes a definition or a \CEE/ part */
  1521.   boolean visible; /* nonzero if we should produce \TEX/ output */
  1522. @y
  1523. @<Predecl...@>=
  1524. static void finish_C(boolean);
  1525.  
  1526. @ @c
  1527. static void finish_C(boolean visible) /* finishes a definition or a \Cee\ part */
  1528.   /* |visible|: nonzero if we should produce \TeX\ output */
  1529. @z
  1530. ------------------------------------------------------------------------------
  1531. TRANSLATION
  1532. @x l.3956
  1533.     err_print("! Improper macro definition");
  1534. @y
  1535.     err_print(get_string(MSG_ERROR_CW213));
  1536. @z
  1537. ------------------------------------------------------------------------------
  1538. TRANSLATION
  1539. @x l.3965
  1540.       default: err_print("! Improper macro definition"); break;
  1541. @y
  1542.       default: err_print(get_string(MSG_ERROR_CW213)); break;
  1543. @z
  1544. ------------------------------------------------------------------------------
  1545. TRANSLATION
  1546. @x l.3991
  1547.   if (scrap_ptr!=scrap_info+2) err_print("! Improper format definition");
  1548. @y
  1549.   if (scrap_ptr!=scrap_info+2) err_print(get_string(MSG_ERROR_CW214));
  1550. @z
  1551. ------------------------------------------------------------------------------
  1552. TRANSLATION
  1553. @x l.4026
  1554.   err_print("! You need an = sign after the section name");
  1555. @y
  1556.   err_print(get_string(MSG_ERROR_CW217));
  1557. @z
  1558. ------------------------------------------------------------------------------
  1559. TRANSLATION
  1560. @x l.4048
  1561.   err_print("! You can't do that in C text");
  1562. @y
  1563.   err_print(get_string(MSG_ERROR_CW218));
  1564. @z
  1565. ------------------------------------------------------------------------------
  1566. ANSI
  1567. @x l.4083
  1568. @<Predecl...@>=
  1569. void footnote();
  1570.  
  1571. @ @c
  1572. void
  1573. footnote(flag) /* outputs section cross-references */
  1574. sixteen_bits flag;
  1575. @y
  1576. @<Predecl...@>=
  1577. static void footnote(sixteen_bits);
  1578.  
  1579. @ @c
  1580. static void footnote(sixteen_bits flag) /* outputs section cross-references */
  1581. @z
  1582. ------------------------------------------------------------------------------
  1583. @x l.4128
  1584. If the user has set the |no_xref| flag (the |-x| option on the command line),
  1585. @y
  1586. If the user has set the |no_xref| flag (the \.{-x} option on the command line),
  1587. @z
  1588. ------------------------------------------------------------------------------
  1589. ANSI
  1590. @x l.4132
  1591. @<Predecl...@>=
  1592. void phase_three();
  1593.  
  1594. @ @c
  1595. void
  1596. phase_three() {
  1597. @y
  1598. @<Predecl...@>=
  1599. static void phase_three(void);
  1600.  
  1601. @ @c
  1602. static void phase_three(void) {
  1603. @z
  1604. ------------------------------------------------------------------------------
  1605. ANSI, TRANSLATION
  1606. Switching from the automatic string to `get_string' causes a timing
  1607. problem.  Obviously the output is buffered, so `fflush' its contents.
  1608. @x l.4145
  1609.   phase=3; if (show_progress) printf("\nWriting the index...");
  1610. @y
  1611.   phase=3;
  1612.   if (show_progress) {
  1613.     printf(get_string(MSG_PROGRESS_CW225)); fflush(stdout);
  1614.   }
  1615. @z
  1616. ------------------------------------------------------------------------------
  1617. TRANSLATION
  1618. @x l.4149
  1619.     fatal("! Cannot open index file ",idx_file_name);
  1620. @y
  1621.     fatal(get_string(MSG_FATAL_CW225_1),idx_file_name);
  1622. @z
  1623. ------------------------------------------------------------------------------
  1624. TRANSLATION
  1625. @x l.4164
  1626.     fatal("! Cannot open section file ",scn_file_name);
  1627. @y
  1628.     fatal(get_string(MSG_FATAL_CW225_2),scn_file_name);
  1629. @z
  1630. ------------------------------------------------------------------------------
  1631. TRANSLATION
  1632. @x l.4176
  1633. if (show_happiness) printf("\nDone.");
  1634. @y
  1635. if (show_happiness) printf(get_string(MSG_PROGRESS_CT42_3));
  1636. @z
  1637. ------------------------------------------------------------------------------
  1638. MEMORY ALLOCATION
  1639. @x l.4210
  1640. name_pointer bucket[256];
  1641. name_pointer next_name; /* successor of |cur_name| when sorting */
  1642. name_pointer blink[max_names]; /* links in the buckets */
  1643. @y
  1644. name_pointer *bucket;
  1645. name_pointer next_name; /* successor of |cur_name| when sorting */
  1646. name_pointer *blink; /* links in the buckets */
  1647. @z
  1648. ------------------------------------------------------------------------------
  1649. PORTABILITY
  1650. @x l.4224
  1651.     if (cur_name->xref!=(char*)xmem) {
  1652. @y
  1653.     if (cur_name->xref!=(void HUGE*)xmem) {
  1654. @z
  1655. ------------------------------------------------------------------------------
  1656. PORTABILITY
  1657. @x l.4254
  1658. char *cur_byte; /* index into |byte_mem| */
  1659. @y
  1660. char HUGE *cur_byte; /* index into |byte_mem| */
  1661. @z
  1662. ------------------------------------------------------------------------------
  1663. MEMORY ALLOCATION
  1664. @x l.4258
  1665. @ @<Set init...@>=
  1666. max_sort_ptr=scrap_info;
  1667. @y
  1668. @ @<Set init...@>=
  1669. alloc_object(bucket,256,name_pointer);
  1670. alloc_object(blink,max_names,name_pointer);
  1671. max_sort_ptr=scrap_info;
  1672. @z
  1673. ------------------------------------------------------------------------------
  1674. MEMORY ALLOCATION
  1675. The \.{@@t} feature causes problems when there are `<' or `>' operators
  1676. placed directly aside the `@t...@>' group.  Most of the other C operators
  1677. work fine.  Provide an improvement of the documentation.
  1678. @x l.4261
  1679. @ The desired alphabetic order is specified by the |collate| array; namely,
  1680. |collate[0]<collate[1]<@t$\cdots$@><collate[100]|.
  1681.  
  1682. @<Global...@>=
  1683. eight_bits collate[102+128]; /* collation order */
  1684. @^high-bit character handling@>
  1685. @y
  1686. @ The desired alphabetic order is specified by the |collate| array; namely,
  1687. |collate[0]@t${}<\cdots<{}$@>collate[100]|.
  1688.  
  1689. @<Global...@>=
  1690. eight_bits *collate; /* collation order */
  1691. @^high-bit character handling@>
  1692. @z
  1693. ------------------------------------------------------------------------------
  1694. ANSI, MEMORY ALLOCATION
  1695. @x l.4275
  1696. collate[0]=0; strcpy(collate+1," \1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\
  1697. \20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37\
  1698. !\42#$%&'()*+,-./:;<=>?@@[\\]^`{|}~_\
  1699. abcdefghijklmnopqrstuvwxyz0123456789\
  1700. \200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\
  1701. \220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\
  1702. \240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\
  1703. \260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\
  1704. \300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\
  1705. \320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\
  1706. \340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\
  1707. \360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\
  1708. ");
  1709. @y
  1710. alloc_object(collate,102+128,eight_bits);
  1711. collate[0]=0; strcpy((char *)collate+1,
  1712.   " \1\2\3\4\5\6\7\10\11\12\13\14\15\16\17"@|
  1713.   "\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37"@|
  1714.   "!\42#$%&'()*+,-./:;<=>?@@[\\]^`{|}~_abcdefghijklmnopqrstuvwxyz0123456789"@|
  1715.   "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217"@|
  1716.   "\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237"@|
  1717.   "\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257"@|
  1718.   "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277"@|
  1719.   "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317"@|
  1720.   "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337"@|
  1721.   "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357"@|
  1722.   "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377");
  1723. @z
  1724. ------------------------------------------------------------------------------
  1725. ANSI
  1726. @x l.4297
  1727. @<Predecl...@>=
  1728. void  unbucket();
  1729.  
  1730. @ @c
  1731. void
  1732. unbucket(d) /* empties buckets having depth |d| */
  1733. eight_bits d;
  1734. @y
  1735. @<Predecl...@>=
  1736. static void unbucket(eight_bits);
  1737.  
  1738. @ @c
  1739. static void unbucket(eight_bits d) /* empties buckets having depth |d| */
  1740. @z
  1741. ------------------------------------------------------------------------------
  1742. TRANSLATION
  1743. @x l.4309
  1744.     if (sort_ptr>=scrap_info_end) overflow("sorting");
  1745. @y
  1746.     if (sort_ptr>=scrap_info_end) overflow(get_string(MSG_OVERFLOW_CW237));
  1747. @z
  1748. ------------------------------------------------------------------------------
  1749. PORTABILITY
  1750. @x l.4358
  1751.     else {char *j;
  1752. @y
  1753.     else {char HUGE *j;
  1754. @z
  1755. ------------------------------------------------------------------------------
  1756. PORTABILITY
  1757. @x l.4373
  1758.   case custom: case quoted: {char *j; out_str("$\\");
  1759. @y
  1760.   case custom: case quoted: {char HUGE *j; out_str("$\\");
  1761. @z
  1762. ------------------------------------------------------------------------------
  1763. ANSI
  1764. @x l.4417
  1765. @<Predecl...@>=
  1766. void section_print();
  1767.  
  1768. @ @c
  1769. void
  1770. section_print(p) /* print all section names in subtree |p| */
  1771. name_pointer p;
  1772. @y
  1773. @<Predecl...@>=
  1774. static void section_print(name_pointer);
  1775.  
  1776. @ @c
  1777. static void section_print(name_pointer p) /* print all section names in subtree |p| */
  1778. @z
  1779. ------------------------------------------------------------------------------
  1780. ANSI, TRANSLATION
  1781. @x l.4439
  1782. @ Because on some systems the difference between two pointers is a |long|
  1783. rather than an |int|, we use \.{\%ld} to print these quantities.
  1784.  
  1785. @c
  1786. void
  1787. print_stats() {
  1788.   printf("\nMemory usage statistics:\n");
  1789. @.Memory usage statistics:@>
  1790.   printf("%ld names (out of %ld)\n",
  1791.             (long)(name_ptr-name_dir),(long)max_names);
  1792.   printf("%ld cross-references (out of %ld)\n",
  1793.             (long)(xref_ptr-xmem),(long)max_refs);
  1794.   printf("%ld bytes (out of %ld)\n",
  1795.             (long)(byte_ptr-byte_mem),(long)max_bytes);
  1796.   printf("Parsing:\n");
  1797.   printf("%ld scraps (out of %ld)\n",
  1798.             (long)(max_scr_ptr-scrap_info),(long)max_scraps);
  1799.   printf("%ld texts (out of %ld)\n",
  1800.             (long)(max_text_ptr-tok_start),(long)max_texts);
  1801.   printf("%ld tokens (out of %ld)\n",
  1802.             (long)(max_tok_ptr-tok_mem),(long)max_toks);
  1803.   printf("%ld levels (out of %ld)\n",
  1804.             (long)(max_stack_ptr-stack),(long)stack_size);
  1805.   printf("Sorting:\n");
  1806.   printf("%ld levels (out of %ld)\n",
  1807.             (long)(max_sort_ptr-scrap_info),(long)max_scraps);
  1808. }
  1809. @y
  1810. @ {\mc ANSI C} declares the difference between two pointers to be of type
  1811. |ptrdiff_t| which equals |long| on (almost) all systems instead of |int|,
  1812. so we use \.{\%ld} to print these quantities and cast them to |long|
  1813. explicitly.
  1814.  
  1815. @c
  1816. void print_stats(void) {
  1817.   printf(get_string(MSG_STATS_CT95_1));
  1818. @.Memory usage statistics:@>
  1819.   printf(get_string(MSG_STATS_CT95_2),
  1820.             (long)(name_ptr-name_dir),(long)max_names);
  1821.   printf(get_string(MSG_STATS_CW248_1),
  1822.             (long)(xref_ptr-xmem),(long)max_refs);
  1823.   printf(get_string(MSG_STATS_CT95_4),
  1824.             (long)(byte_ptr-byte_mem),(long)max_bytes);
  1825.   printf(get_string(MSG_STATS_CW248_2));
  1826.   printf(get_string(MSG_STATS_CW248_3),
  1827.             (long)(max_scr_ptr-scrap_info),(long)max_scraps);
  1828.   printf(get_string(MSG_STATS_CW248_4),
  1829.             (long)(max_text_ptr-tok_start),(long)max_texts);
  1830.   printf(get_string(MSG_STATS_CT95_5),
  1831.             (long)(max_tok_ptr-tok_mem),(long)max_toks);
  1832.   printf(get_string(MSG_STATS_CW248_5),
  1833.             (long)(max_stack_ptr-stack),(long)stack_size);
  1834.   printf(get_string(MSG_STATS_CW248_6));
  1835.   printf(get_string(MSG_STATS_CW248_5),
  1836.             (long)(max_sort_ptr-scrap_info),(long)max_scraps);
  1837. }
  1838. @z
  1839. ------------------------------------------------------------------------------
  1840. ANSI, SYSTEM DEPENDENCIES
  1841. @x l.4467
  1842. @** Index.
  1843. @y
  1844. @** Function declarations.  Here are declarations---conforming to
  1845. {\mc ANSI~C}---of all functions in this code, as far as they are
  1846. not already in |"common.h"|.  These are private to \.{CWEAVE}.
  1847.  
  1848. @<Predecl...@>=
  1849. static eight_bits copy_TeX(void);@/
  1850. static eight_bits get_output(void);@/
  1851. static text_pointer C_translate(void);@/
  1852. static text_pointer translate(void);@/
  1853. static token_pointer find_first_ident(text_pointer);@/
  1854. static unsigned skip_TeX(void);@/
  1855. static void app_str(char *);@/
  1856. static void big_app(token);@/
  1857. static void big_app1(scrap_pointer);@/
  1858. static void copy_limbo(void);@/
  1859. static void C_parse(eight_bits);@/
  1860. static void finish_line(void);@/
  1861. static void flush_buffer(char *,boolean,boolean);@/
  1862. static void make_reserved(scrap_pointer);@/
  1863. static void make_underlined(scrap_pointer);@/
  1864. static void new_section_xref(name_pointer);@/
  1865. static void new_xref(name_pointer);@/
  1866. static void outer_parse(void);@/
  1867. static void output_C(void);@/
  1868. static void out_name(name_pointer);@/
  1869. static void out_section(sixteen_bits);@/
  1870. static void out_str(char *);@/
  1871. static void pop_level(void);@/
  1872. static void print_cat(eight_bits);@/
  1873. static void print_text(text_pointer p);@/
  1874. static void push_level(text_pointer);@/
  1875. static void reduce(scrap_pointer,short,eight_bits,short,short);@/
  1876. static void set_file_flag(name_pointer);@/
  1877. static void skip_limbo(void);@/
  1878. static void squash(scrap_pointer,short,eight_bits,short,short);@/
  1879. #ifdef DEAD_CODE
  1880. static void out_str_del(char *,char *);@/
  1881. #endif
  1882.  
  1883. @** System specific keywords.  For the convenience of {\mc AMIGA} users a
  1884. list of additional keywords is appended to \.{CWEAVE}'s internal tables.
  1885. Some of these are introduced by Commodore's operating system, others by
  1886. the {\mc SAS/C} compiler.
  1887. @^system dependencies@>
  1888.  
  1889.  @<Keywords specific to {\mc SAS/C}@>=
  1890.    id_lookup("__aligned",NULL,int_like);@+
  1891.    id_lookup("__asm",NULL,int_like);
  1892.    id_lookup("__chip",NULL,int_like);@+
  1893.    id_lookup("__far",NULL,int_like);
  1894.    id_lookup("__inline",NULL,int_like);@+
  1895.    id_lookup("__interrupt",NULL,int_like);
  1896.    id_lookup("__near",NULL,int_like);@+
  1897.    id_lookup("__regargs",NULL,int_like);
  1898.    id_lookup("__saveds",NULL,int_like);@+
  1899.    id_lookup("__stackext",NULL,int_like);
  1900.    id_lookup("__stdargs",NULL,int_like);
  1901.  
  1902. @ @<Registers of the {\mc AMIGA}@>=
  1903.    id_lookup("__d0",NULL,int_like);@+
  1904.    id_lookup("__d1",NULL,int_like);
  1905.    id_lookup("__d2",NULL,int_like);@+
  1906.    id_lookup("__d3",NULL,int_like);
  1907.    id_lookup("__d4",NULL,int_like);@+
  1908.    id_lookup("__d5",NULL,int_like);
  1909.    id_lookup("__d6",NULL,int_like);@+
  1910.    id_lookup("__d7",NULL,int_like);
  1911.    id_lookup("__a0",NULL,int_like);@+
  1912.    id_lookup("__a1",NULL,int_like);
  1913.    id_lookup("__a2",NULL,int_like);@+
  1914.    id_lookup("__a3",NULL,int_like);
  1915.    id_lookup("__a4",NULL,int_like);@+
  1916.    id_lookup("__a5",NULL,int_like);
  1917.    id_lookup("__a6",NULL,int_like);@+
  1918.    id_lookup("__a7",NULL,int_like);
  1919.    id_lookup("__fp0",NULL,int_like);@+
  1920.    id_lookup("__fp1",NULL,int_like);
  1921.    id_lookup("__fp2",NULL,int_like);@+
  1922.    id_lookup("__fp3",NULL,int_like);
  1923.    id_lookup("__fp4",NULL,int_like);@+
  1924.    id_lookup("__fp5",NULL,int_like);
  1925.    id_lookup("__fp6",NULL,int_like);@+
  1926.    id_lookup("__fp7",NULL,int_like);
  1927.  
  1928. @ @<Keywords by Commodore@>=
  1929.    id_lookup("GLOBAL",NULL,int_like);@+
  1930.    id_lookup("IMPORT",NULL,int_like);
  1931.    id_lookup("STATIC",NULL,int_like);@+
  1932.    id_lookup("REGISTER",NULL,int_like);
  1933.    id_lookup("VOID",NULL,int_like);@+
  1934.    id_lookup("APTR",NULL,int_like);
  1935.    id_lookup("LONG",NULL,int_like);@+
  1936.    id_lookup("ULONG",NULL,int_like);
  1937.    id_lookup("LONGBITS",NULL,int_like);@+
  1938.    id_lookup("WORD",NULL,int_like);
  1939.    id_lookup("UWORD",NULL,int_like);@+
  1940.    id_lookup("WORDBITS",NULL,int_like);
  1941.    id_lookup("BYTE",NULL,int_like);@+
  1942.    id_lookup("UBYTE",NULL,int_like);
  1943.    id_lookup("BYTEBITS",NULL,int_like);@+
  1944.    id_lookup("RPTR",NULL,int_like);
  1945.    id_lookup("STRPTR",NULL,int_like);@+
  1946.    id_lookup("SHORT",NULL,int_like);
  1947.    id_lookup("USHORT",NULL,int_like);@+
  1948.    id_lookup("COUNT",NULL,int_like);
  1949.    id_lookup("UCOUNT",NULL,int_like);@+
  1950.    id_lookup("CPTR",NULL,int_like);
  1951.    id_lookup("FLOAT",NULL,int_like);@+
  1952.    id_lookup("DOUBLE",NULL,int_like);
  1953.    id_lookup("BOOL",NULL,int_like);@+
  1954.    id_lookup("TEXT",NULL,int_like);
  1955.    id_lookup("BPTR",NULL,int_like);@+
  1956.    id_lookup("BSTR",NULL,int_like);
  1957.  
  1958.    id_lookup("byte",NULL,int_like);@+
  1959.    id_lookup("Class",NULL,int_like);
  1960.    id_lookup("ClassID",NULL,int_like);@+
  1961.    id_lookup("CxMsg",NULL,int_like);
  1962.    id_lookup("CxObj",NULL,int_like);@+
  1963.    id_lookup("dev_t",NULL,int_like);
  1964.    id_lookup("DIR",NULL,int_like);@+
  1965.    id_lookup("DisplayInfoHandle",NULL,int_like);
  1966.    id_lookup("ino_t",NULL,int_like);@+
  1967.    id_lookup("IX",NULL,int_like);
  1968.    id_lookup("Msg",NULL,int_like);@+
  1969.    id_lookup("Object",NULL,int_like);
  1970.    id_lookup("off_t",NULL,int_like);@+
  1971.    id_lookup("PFL",NULL,int_like);
  1972.    id_lookup("PLANEPTR",NULL,int_like);@+
  1973.    id_lookup("Tag",NULL,int_like);
  1974.    id_lookup("tPoint",NULL,int_like);@+
  1975.    id_lookup("ushort",NULL,int_like);
  1976.    id_lookup("u_char",NULL,int_like);@+
  1977.    id_lookup("u_int",NULL,int_like);
  1978.    id_lookup("u_long",NULL,int_like);@+
  1979.    id_lookup("u_short",NULL,int_like);
  1980.    id_lookup("WINDOW",NULL,int_like);
  1981.  
  1982. @* Version information.  The {\mc AMIGA} operating system provides the
  1983. `version' command and good programs answer with some informations about
  1984. their creation date and their current version.
  1985.  
  1986. @<Glob...@>=
  1987. #ifdef _AMIGA
  1988. const unsigned char *Version = "$VER: CWeave 3.1 [p9d] "__AMIGADATE__;
  1989. #endif
  1990. @^system dependencies@>
  1991.  
  1992. @** Index.
  1993. @z
  1994. ------------------------------------------------------------------------------
  1995.